package com.cg.design.graphicdesignpattern.abstractfactory.listfactory;

import com.cg.design.graphicdesignpattern.abstractfactory.factory.Factory;
import com.cg.design.graphicdesignpattern.abstractfactory.factory.Link;
import com.cg.design.graphicdesignpattern.abstractfactory.factory.Page;
import com.cg.design.graphicdesignpattern.abstractfactory.factory.Tray;

/**
 * 具体的工厂：ListFactory类，简单的实现了Factory抽象类（new出的实例）
 *
 * @program: LeetCode->ListFactory
 * @description: 具体的工厂：ListFactory类，简单的实现了Factory抽象类（new出的实例）
 * @author: cg
 * @create: 2022-03-21 23:36
 **/
public class ListFactory extends Factory {

    @Override
    public Link createLink(String caption, String url) {
        return new ListLink(caption, url);
    }

    @Override
    public Tray createTray(String caption) {
        return new ListTray(caption);
    }

    @Override
    public Page createPage(String title, String author) {
        return new ListPage(title, author);
    }
}
